USE T2Logging
GO

GO
-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_CATALOG = N'T2Logging' 
	 AND SPECIFIC_SCHEMA = N'dbo'
     AND SPECIFIC_NAME = N'uspLogError' 
)
   DROP PROCEDURE dbo.uspLogError
GO

/****** Object:  StoredProcedure [dbo].[uspLogError]    Script Date: 10/07/2009 08:27:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[uspLogError]
	
--*************************************************************
--Created By: trooks
--Database: T2Logging
--Created Date: 02/15/2013 20:07:16
--*************************************************************

AS
	--Create the log first and get the return value for the Log_Id

	SELECT 
			ERROR_NUMBER() AS ErrNum,
			ERROR_SEVERITY() AS ErrSev,
			ERROR_STATE() as ErrState,
			ERROR_PROCEDURE() as ErrProc,
			ERROR_LINE() as ErrLine,
			ERROR_MESSAGE() as ErrMsg ;
	
	
	


